package com.ziroom.zifamily.zfcensor.resources;

import com.ziroom.zifamily.base.ZfIdGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>监控类</p>
 * <p>
 * <PRE>
 * <BR>    修改记录
 * <BR>-----------------------------------------------
 * <BR>    修改日期         修改人          修改内容
 * </PRE>
 *
 * @author cuiyh9
 * @version 1.0
 * @Date Created in 2018年11月24日 16:09
 * @since 1.0
 */
@RestController
@RequestMapping("monitor")
public class MonitorResource {

    @Autowired
    private ZfIdGenerator idGenerator;

    /**
     * 运维v.ziroom.com监控使用
     * @return
     */
    @RequestMapping("v")
    public String monitor() {
        return "ok";
    }

    @RequestMapping("id")
    public String id() {
        long id = idGenerator.nextId();
        return String.valueOf(id);
    }
}
